package com.example.productmanagerspringboot.data.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

@Data
@TableName("t_product")
public class Good {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String intro;
    private double price;
    @TableField("stock_num")
    private int stockNum;
    @TableField("photo")
    private String goodsCoverImg;
    @Range(max = 1, message = "只能为0或1")
    private int sold;
    private String tag;
    @TableField("content")
    private String goodsDetailContent;
    @TableField("owner_id")
    private int ownerId;
}
